const expressJoi = require('@escook/express-joi');
const express = require('express');
const router = express.Router();
const class_schema = require('../utils/schema/class')
const class_router = require('../controller/class')

router.get("/Alllist", class_router.getAllList)

router.get("/list", class_router.getListisNotDel)

router.post("/add", expressJoi(class_schema.add_schema), class_router.addClass)

router.delete("/delete/:id", expressJoi(class_schema.del_schema), class_router.deleteClass)

router.put("/update", expressJoi(class_schema.update_schema), class_router.updateById)

// 课程的操作
router.post("/addCourse", expressJoi(class_schema.addCourse_schema), class_router.addCourse)
router.put("/updateCourse", expressJoi(class_schema.updateCourse_schema), class_router.updateCourse)
// 获取这个班的课程
router.get("/courselist/:id", expressJoi(class_schema.getCourseList_schema), class_router.getCourseList)
router.get("/courseNotList/:id", expressJoi(class_schema.getCourseList_schema), class_router.getCourseNotList)

module.exports = router